package s03;

public class N04 { //身份证类
	
	public N04(String id) throws Exception {
		if(id.length()!=18)throw new Exception("身份证应该是18位~");
		if(!id.substring(0, 4).equals("4101"))throw new Exception("不是郑州的身份证~");
		if("01,02,05,20".indexOf(id.substring(4,6))==-1)throw new Exception("郑州身份证编码错误~");
	}
	public static void main(String[] args) {
		try {
			N04 id = new N04("410105200005100026");
			System.out.println("身份证校验正常~");
		} catch (Exception e) {
//			e.printStackTrace();
			System.out.println(e.getMessage());
		}
		System.out.println("Over");
		
	}
}
